package qingke.struts.example1.action;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import com.opensymphony.xwork2.ActionSupport;

public class StreamAction  extends ActionSupport{
	
	private InputStream inputStream;
	private String fileName;
	
	public StreamAction(){
		
	}
    
	public String execute(){
		String file="D:\\eclipse\\StrutsExample\\src\\main\\webapp\\image\\gouge.jpg";
		try{
			inputStream =new FileInputStream(new File(file));
			fileName="download.jpg";
		}catch(Exception e){
			return ERROR;
		}
		return SUCCESS;
		
	}
	
	
	public InputStream getInputStream() {
		return inputStream;
	}

	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	

}
